package com.ndp.fb.enums.targetingspec;

import lombok.Getter;

/**
 * Created by Sisi on 14-11-14.
 */
@Getter
public enum UserOs {
    iOS(1, "iOS"),

    Android(2, "Android");

    private int code;

    private String userOs;

    UserOs(int code, String userOs) {
        this.code = code;
        this.userOs = userOs;
    }

    /**
     * 根据code获取userOs
     *
     * @param code code
     * @return userOs
     */
    public static UserOs getUserOs(int code) {
        for (UserOs c : UserOs.values()) {
            if (c.code == code) {
                return c;
            }
        }
        return null;
    }
}
